package com.xuyuan.protocol;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MyCustomProtocolController {

    @PostMapping("/custom-protocol")
    public MyCustomProtocol handleCustomProtocol(@RequestBody MyCustomProtocol request) {
        System.out.println("Received custom protocol: " + request);
        MyCustomProtocol response = new MyCustomProtocol();
        response.setType(2);
        response.setContent("Response to " + request.getContent());
        return response;
    }
}
